home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir26 / epi601_2.zip / FILES07.EXE / ARTIFACT.PGM < prev    next >
Text File  |  1994-08-22  |  2KB  |  42 lines

  1. *Program to generate data for the questionnaire ARTIFACT.REC
  2. *Before running this program, you should erase any file called ARTIFACT.REC
  3. * and create a new one in the ENTER program from the questionnaire ARTIFACT.QES
  4. READ ARTIFACT
  5. ECHO
  6. ECHO Generating data.  Please be patient and watch the upper right screen corner.
  7. *Generate ID numbers to put in the new file using a cumulative variable
  8. DEFINE ID #### CUMULATIVE
  9. ID = ID + 1
  10. IDNUMBER = ID
  11. *A special feature of RECODE assigns M if the random number from 0 to 1 is
  12. * between 0 and .70, F if from .71 to .95 and unknown if .96 to 1.00.
  13. RECODE RND TO SEX 70% = M 25%=F ELSE = .
  14. *Assign a random integer from 0 to 65 to AGE
  15. AGE = RAN (65)
  16. *Modify this so that there is a 65% chance of having an age from 20 to 30
  17. IF RND(1) > 0.45 THEN AGE = RAN(10) + 20
  18. *Make the reporting period start on a particular date
  19. REPORTDATE = "01/01/89"
  20. *Allow it to continue for 400 days
  21. REPORTDATE = REPORTDATE + RAN 400
  22. *Make 60% of answers Y; 37% N, and the rest unknown.
  23. RECODE RND TO OPPORTUNIS 60% = Y 37% = N ELSE = .
  24. *Set up the two remaining variables
  25. RECODE RND TO KAPOSISARC 55%=y 45%=N ELSE = .
  26. RECODE RND TO HIV1 80%=y 27%=N ELSE=.
  27. *Now create 100 such records.
  28. GENERATE 100
  29.  
  30. *Check the frequencies to see the results
  31. ?Press any key to see the .REC file...?
  32. READ ARTIFACT.REC
  33. TYPE ARTIFACT.REC
  34. ECHO End of Results; Use PgUp to examine more closely.
  35. ?Press any key to see a frequency of KAPOSISARC ?
  36. ECHO The expected rate is 55% Y and 45% N
  37. SET IGNORE = OFF
  38. FREQ KAPOSISARC
  39. ?Press any key for a graph of AGE ...?
  40. LINE AGE
  41. ?Press <F10> to leave ANALYSIS, or any other key to remain in ANALYSIS ?
  42.